<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Starter</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<body class="fixed hold-transition skin-blue">
    <div class="wrapper">

        <!-- Main Header -->
        <div th:replace="tophtml::html"></div>
        <!-- Left side column. contains the logo and sidebar -->
        <div th:replace="left::html"></div>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   <span>修改客户</span> 
                    <small>(<span style="color: red">*</span> 为必填项目)</small>
                </h1>
                <ol class="breadcrumb">
                  <li><a href="/index"><i class="fa fa-dashboard"></i>用户中心</a></li>
					<li><a href="/customer/customerList">客户管理</a></li>
					<li><a href="#">修改客户</a></li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content container-fluid">
                <form th:action="@{/customer/saveUpdateCustomer}" method="post" th:object="${customer}" id="form1" enctype="multipart/form-data">
                    <input type="hidden" th:value="${pid}" class="form-control"
						name="pid"> 
						
				    <input type="hidden" th:value="${customer.evolve}" class="form-control"
						name="evolve"> 
						
					<input type="hidden" th:value="${customer.customerNumber}" class="form-control"
						name="customerNumber"> 
						
						<input type="hidden" th:value="${origType}" class="form-control"
						name="origType"> 
						
						<input type="hidden" th:value="${conferencePid}" class="form-control"
						name="conferencePid"> 

                    <div class="form-group">
						<label for="customerName">客户名称</label><span style="color: red">*</span>
						 <input type="text" class="form-control required"
							th:value="${customer.customerName}" name="customerName">
							<p style="color: red;" th:if="${#fields.hasErrors('customerName')}" th:errors="*{customerName}">Error</p>
					</div>
					
					<div class="form-group">
						<label>客户性质</label><span style="color: red">*</span>
						 <select class="form-control"
							name="customerNature">
							<option th:each="psd : ${customerNatureList}"
								th:selected="${psd.pid eq customer.customerNature}" th:value="${psd.pid}" th:text="${psd.worth}">客户性质</option>
						</select>
					</div>

					<div class="form-group">
						<label>客户来源</label>
						<span style="color: red">*</span>
						 <select class="form-control"
							name="customerSource">

							<option th:each="psd : ${customerSourceList}"
								th:selected="${psd.pid eq customer.customerSource}"
								th:value="${psd.pid}" th:text="${psd.worth}">客户来源</option>
						</select>
					</div>

					<div class="form-group">
						<label>客户类型</label> <span style="color: red">*</span>
						<select class="form-control"
							name="customerType">
							<option th:each="psd : ${customerTypeList}"
								th:value="${psd.pid}"
								th:selected="${psd.pid eq customer.customerType}"
								th:text="${psd.worth}">客户类型</option>
						</select>
					</div>


					<div class="form-group">
					<p style="color: red;" th:if="${#fields.hasErrors('researchField')}" th:errors="*{researchField}">Error</p>
						<label for="researchField">所属领域</label>
						 <span style="color: red">*</span>
						 <div class="checkbox" th:each="rfd : ${researchFieldDictiontryList}">
                            <label>
                                <input type="checkbox" name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${#arrays.contains(researchFieldArr, rfd.names)}" required>
                            </label>
                        </div>
					</div>
					
					 <div class="form-group">
					 <p style="color: red;"
							th:if="${#fields.hasErrors('area')}"
							th:errors="*{area}">Error</p>
                        <label>国内国外</label>
                        <span style="color: red">*</span>
                        <p style="color: red;" th:text="${domesticOrForeign}"></p>
                        <div class="radio">
                            <label>
                                <input type="radio" name="domesticOrForeign" id="optionsRadios1" value="0" th:checked="${customer.domesticOrForeign == 0}"> 国内
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" th:checked="${customer.domesticOrForeign == 1}"> 国外
                            </label>
                        </div>
                    </div>
                    <!-- 选择国内必须选地区 -->
                    <div class="form-group form-area">
                        <label>省</label>
                        <span style="color: red">*</span>
                        <p style="color: red;" th:text="${area}"></p>
                        <select class="form-control form-area" id="provinceId">
                            <option value="-1">--选择省--</option>
                            <option th:each="list:${provinceDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq province}"></option>
                        </select>
                    </div>
                    <div class="form-group form-area">
                        <label>市</label>
                        <select class="form-control form-area" id="cityId">
                            <option value="-1">--选择市--</option>
                            <option th:each="list:${cityDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq cityId}"></option>
                        </select>
                    </div>
                    <div class="form-group form-area">
                        <label>区</label>
                        <select class="form-control form-area" id="areaId">
                            <option value="-1">--选择区--</option>
                            <option th:each="list:${areaDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq areaId}"></option>
                        </select>
                    </div>
                    
					
					<div class="form-group form-country">
                        <label>国家</label>
                        <span style="color: red">*</span>
                        <p style="color: red;" th:text="${area}"></p>
                        <select class="form-control form-area">
                            <option value="-1">--选择国家--</option>
                            <option th:each="list:${countryDictiontryList}" th:value="${list.pid}" th:text="${list.worth}" th:selected="${list.pid eq countryId}"></option>
                        </select>
                    </div>

					<div class="form-group">
						<label>主营业务</label> <input type="text" class="form-control"
							 th:value="${customer.mainBusiness}" name="mainBusiness">
					</div>


					<div class="form-group">
						<label>主要需求</label> <input type="text" class="form-control"
							th:value="${customer.majorNeeds}" name="majorNeeds">
					</div>
					
					<div class="form-group">
						<label for="exampleInputFile">附件</label> <input type="file"
							name="customerFiles" id="customerFiles">

						<p class="help-block">Example block-level help text here.</p>
					</div>
					
					<div class="form-group">
						<label>最新进展</label> 
						<textarea class="form-control" name="newEvolve"></textarea>
					</div>
					
					<div class="form-group">
						<label>历史合作情况</label> 
						<textarea class="form-control" name="historywork"  th:text="${customer.historywork}"></textarea>
					</div>


                    <div class="form-group">
						<label>意向合作方式1</label> <select class="form-control"
							name="intentionCooperate2">
							<option th:each="psd : ${intentionCooperateList2}"
								th:selected="${psd.pid eq customer.intentionCooperate2}"  th:value="${psd.pid}" th:text="${psd.worth}">意向合作方式</option>
						</select>
					</div>

					<div class="form-group">
						<label>意向合作方式2</label> <select class="form-control"
							name="intentionCooperate">
							<option th:each="psd : ${intentionCooperateList}"
								th:selected="${psd.pid eq customer.intentionCooperate}"  th:value="${psd.pid}" th:text="${psd.worth}">意向合作方式</option>
						</select>
					</div>

					<div class="form-group">
						<label>当前合作状态</label><select class="form-control"
							name="currentState">
							<option th:each="psd : ${currentStateList}" th:value="${psd.pid}"
								th:selected="${psd.pid eq customer.currentState}" th:text="${psd.worth}">当前合作状态</option>
						</select>
					</div>
					
					<div class="form-group">
						<label>备注1</label> <input type="text" class="form-control"
							th:value="${customer.remark1}" name="remark1">
					</div>
					
					<div class="form-group">
						<label>备注2</label> <input type="text" class="form-control"
							th:value="${customer.remark2}" name="remark2">
					</div>

					
					<div style="width:240px; height: 30px; position:fixed;left:770px;bottom:10px;">
						<button type="submit" class="btn btn-primary">提交</button>
						<button type="button" class="btn btn-primary" onclick="window.history.go(-1)" style="margin-left: 30px;">返回</button>
					</div>

                </form>
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->

        <!-- Main Footer -->
        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>
    </div>
    <div th:replace="bottom::html" ></div>
</body>

</html>